package com.shop.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.shop.dao.UserDao;
import com.shop.domain.Cart;
import com.shop.domain.Favorite;
import com.shop.domain.MessageCenter;
import com.shop.domain.Order;
import com.shop.domain.User;
import com.shop.service.UserService;

/**
 * 
 * @author wenjuanhenxing
 * @version V1.0 UserServiceImpl.java 2016-2-12 下午10:54:33
 */
@Service("userServiceImpl")
public class UserServiceImpl implements UserService {

	@Resource(name = "userDaoImpl")
	private UserDao userDao;

	@Override
	public boolean usernameExists(String username) {
		return findByUsername(username) != null;
	}

	@Override
	public boolean usernameDisabled(String username) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean emailExists(String email) {
		return findListByEmail(email) != null;
	}

	@Override
	public boolean add(User user) {
		return userDao.addUser(user);
	}

	@Override
	public boolean update(User user) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public User findByUsername(String username) {
		return userDao.getUserByUsername(username);
	}

	@Override
	public User findListByEmail(String email) {
		return userDao.getUserByEmail(email);
	}

	@Override
	public boolean isLogin() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public User getCurrent() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getCurrentUsername() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<User> getAllUsers() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public User getUserById(Long id) {
		return userDao.getUserById(id);
	}

	@Override
	public User getUserByName(String username) {
		return userDao.getUserByUsername(username);
	}

	@Override
	public boolean deleteUserById(Long id) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean finishCertify(User user) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public List<Cart> getCarts(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Favorite> getFavorites(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<MessageCenter> getReceiveMessages(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<MessageCenter> getSendMessages(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Order> getBuyOrders(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Order> getSaleyOrders(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean updateRealName(User user) {
		return userDao.updateRealName(user);
	}

	@Override
	public boolean updateCertifyStatus(User user) {
		return userDao.updateCertifyStatus(user);
	}

}
